package com.ad.platform.common.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ Description   :  mybatis 配置
 *                      MapperScan必须添加对应mapper包
 * @ Author        :  zyw
 * @ CreateDate    :  5/24/2020 8:42 PM
 * @ UpdateDate    :  5/24/2020 8:42 PM
 * @ UpdateRemark  :
 * @ Version       :  1.0
 */
@Configuration
@MapperScan(basePackages = { "com.ad.platform.mapper" })
public class MybatisPlusConfig {

    /**
     * mybatis-plus分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        paginationInterceptor.setLimit(-1);
        return paginationInterceptor;
    }
}